<script type='text/javascript' src="<?php echo $this->basePath('public/css/dbblack/js/artdialog/artDialog.js?skin=simple'); ?>"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('public/css/dbblack/js/form/style.css'); ?>"/>
<script type='text/javascript' src="<?php echo $this->basePath('public/css/dbblack/js/form/form.js'); ?>"></script>
<link type="text/css" rel="stylesheet" href="<?php echo $this->basePath('public/css/dbblack/css/product.css'); ?>" />
<link type="text/css" rel="stylesheet" href="<?php echo $this->basePath('public/css/dbblack/js/stars/stars.css'); ?>" />
<script type='text/javascript' src="<?php echo $this->basePath('public/css/dbblack/js/stars/stars.js'); ?>"></script>

<div class="container">
	<div class="layout-2col mt20 clearfix" >
		<div class="sidebar">
			<div class="box">
				<h2 class="title"><?php echo $this->translate('商品信息'); ?>：</h2>
				<div  style="width: 200px; padding:15px;" >
					<img class="big-pic" width="200px"  src="<?php echo $this->basePath($this->frontwebsite()->shopGoodsImage($this->goods_info->goods_image)); ?>" source="<?php echo $this->basePath($this->frontwebsite()->shopGoodsImage($this->goods_info->goods_image)); ?>">
					<h1><a href="<?php echo $this->url('frontgoods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->goods_info->class_id)); ?>"><?php echo $this->escapeHtml($this->goods_info->goods_name); ?></a></h1>
					<p class="tc"><a href="<?php echo $this->url('frontgoods/default', array('goods_id'=>$this->goods_info->goods_id, 'class_id'=>$this->goods_info->class_id)); ?>" class="btn btn-main" target="_blank"><?php echo $this->translate('前去购买'); ?></a></p>
				</div>

			</div>
		</div>
		<div class="content">
			<div class="spec-info mt10 clearfix">
				<h1 class="title"><span style="font-size: 14px;"><?php echo $this->translate('我要评价'); ?>(<strong><?php if ($this->goods_info->comment_state) echo $this->translate('已评价'); else echo $this->translate('未评价'); ?></strong>)：</span></h1>
				<hr>
				<form action="" method="post">
					<table class="mt20 " style="width:100%">
						<tr><td class="label" width="100" style="font-weight: bold"><?php echo $this->translate('商品满意度'); ?><span class="must_add_value">*</span></td> <td>
								<div class=rate-comm id='rate-comment'></div>
								<input style="visibility: hidden;width: 10px;" name="goods_evaluation" id="comment-point" pattern="int" alt="<?php echo $this->translate('打分后才能提交'); ?>！"><label></label>
							</td>
						</tr>
						<?php if ($this->goods_info->comment_state and isset($this->goodsCommentInfo) and !empty($this->goodsCommentInfo)) { ?>
							<tr class="mt20"><td class="label" style="height: 70px;font-weight: bold"><?php echo $this->translate('评价内容'); ?></td> <td><?php echo $this->escapeHtml($this->goodsCommentInfo->comment_body); ?></td></tr>
							<tr><td colspan="2" class="tc">
									<button class="btn btn-primary" onclick="location.href='<?php echo $this->url('frontorder/default/order_page', array('action'=>'index', 'page'=>$this->page, 'order_state'=>$this->order_state)); ?>'" type="button"><i class=" icon-arrow-left icon-white"></i> <?php echo $this->translate('返回订单列表'); ?></button>
								</td></tr>
						<?php } else { ?>
							<tr class="mt20"><td class="label" style="font-weight: bold"><?php echo $this->translate('评价内容'); ?><span class="must_add_value">*</span></td> <td><div class="mt20"><textarea name="comment_body" pattern="required" alt="<?php echo $this->translate('评价内容不能为空'); ?>！" style="height: 140px; width:100%"></textarea></div></td></tr>
							<tr><td colspan="2" class="tc">
									<input type="submit" value="<?php echo $this->translate('提交评价'); ?>" class="btn btn-main">&nbsp;&nbsp;&nbsp;&nbsp;
									<button class="btn btn-primary" onclick="location.href='<?php echo $this->url('frontorder/default/order_page', array('action'=>'index', 'page'=>$this->page, 'order_state'=>$this->order_state)); ?>'" type="button"><i class=" icon-arrow-left icon-white"></i> <?php echo $this->translate('返回订单列表'); ?></button>
								</td></tr>
						<?php } ?>
					</table>
				</form>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	<?php if ($this->goods_info->comment_state and isset($this->goodsCommentInfo) and !empty($this->goodsCommentInfo)) { ?>
	var options = {
		enabled		: false,
		value 		: 4,
		image		: '<?php echo $this->basePath('public/css/dbblack/js/stars/stars.jpg'); ?>',
		defaultTips	: false,
		clickTips   : false
	};
	$('#rate-comment').rater(options);
	<?php } else { ?>
	$(function(){
		var options = {
			max : 5,
			image:'<?php echo $this->basePath('public/css/dbblack/js/stars/stars.jpg'); ?>',
			imageAll:'<?php echo $this->basePath('public/css/dbblack/js/stars/stars-all.gif'); ?>',
			title_format    : function(value) {
				var title = '';
				switch (value) {
					case 1 :
						title   = '<?php echo $this->translate('评价内容'); ?>很不满意';
						break;
					case 2 :
						title   = '<?php echo $this->translate('评价内容'); ?>不满意';
						break;
					case 3 :
						title   = '<?php echo $this->translate('评价内容'); ?>一般';
						break;
					case 4 :
						title   = '<?php echo $this->translate('评价内容'); ?>满意';
						break;
					case 5 :
						title   = '<?php echo $this->translate('评价内容'); ?>非常满意';
						break;
					default :
				}
				$('#comment-point').val(value);
				FireEvent(document.getElementById('comment-point'),'change');
				return title;
			},
			info_format : function(value) {
				var info = '';
				switch (value) {
					case 1 :
						info    = '<div class="info-box"><?php echo $this->translate('1分&nbsp;很不满意'); ?><div><?php echo $this->translate('商品样式和质量都非常差，太令人失望了！'); ?></div></div>';
						break;
					case 2 :
						info    = '<div class="info-box"><?php echo $this->translate('2分&nbsp;不满意'); ?><div><?php echo $this->translate('商品样式和质量不好，不能满足要求。'); ?></div></div>';
						break;
					case 3 :
						info    = '<div class="info-box"><?php echo $this->translate('3分&nbsp;一般'); ?><div><?php echo $this->translate('商品样式和质量感觉一般。'); ?></div></div>';
						break;
					case 4 :
						info    = '<div class="info-box"><?php echo $this->translate('4分&nbsp;满意'); ?><div><?php echo $this->translate('商品样式和质量都比较满意，符合我的期望。'); ?></div></div>';
						break;
					case 5 :
						info    = '<div class="info-box"><?php echo $this->translate('5分&nbsp;非常满意'); ?><div><?php echo $this->translate('我很喜欢！商品样式和质量都很满意，太棒了！'); ?></div></div>';
						break;
					default :
						info = value;
						break;
				}
				return info;
			}
		}
		$('#rate-comment').rater(options);
	})
	<?php } ?>
</script>